package com.atguigu.crowd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//view-controller的注解版
@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // 浏览器访问地址
        String urlPath = "/auth/member/to/reg/page";
        // 目标视图名称
        String viewName = "member-reg"; //根据此配置文件中  thymeleaf配置 拼前/后缀
        // prefix: classpath:/templates/
        //    suffix: .html


        // 添加view-controller
        registry.addViewController(urlPath).setViewName(viewName);
        registry.addViewController("/auth/member/to/login/page").setViewName("member-login");
        registry.addViewController("/auth/member/to/center/page").setViewName("member-center");
//        registry.addViewController("/auth/member/my/crowd").setViewName("member-crowd");
        registry.addViewController("/auth/member/apply/result").setViewName("member-apply-result");
        registry.addViewController("/auth/member/auth1").setViewName("member-auth1");
//        registry.addViewController("/auth/member/auth2").setViewName("member-auth2");

        registry.addViewController("/auth/member/auth4").setViewName("member-auth3");

        registry.addViewController("/auth/member/auth6").setViewName("member-auth4");

        registry.addViewController("/auth/member/auth8").setViewName("member-auth5");


    }
}
